#{extends 'include/base.html' /}
#{set title:'发件箱' /}
<a name="top"></a>
<div class="box visual">
</div>
<div class="email_win visual">
    <form action="@{Api.writeMail()}">
        <p class="email_win_title">&nbsp站内信</p>
        <p class="hidden mail_err" style="width: 100%;text-align: center;color:red; font-size: 15px;">错误</p>
        <div class="input_wrap box_input_wrap">
            <label for="">标题:</label>
            <input type="text" class="box_input"  name="mail.title" id="title" />
            <input type="hidden" value="${user.id}"  name="mail.receive_id" id="receive_id" />
        </div>
        <div class="input_wrap">
            <label for="">内容:</label>
            <textarea class="box_text"  name="mail.content" id="content" ></textarea>
        </div>
        <div class="btn_wrap_box">
            <button class="btn btn_wrap_box_send" id="btn">发送</button>
            <button class="btn btn_wrap_box_end" type="reset">取消</button>
        </div>
    </form>
    <img src="../public/images/close.png" alt="" class="email_close"/>
</div>
<div class="work_nav">
    <ul>
        <li><a href="@{Members.home()}">个人主页</a></li>
        <li><a href="@{Members.editor()}">个人资料</a></li>
        <li><a href="@{Members.reciveEmail()}">收件箱</a></li>
        <li class="work_nav_active"><a href="@{Members.sendEmail()}">发件箱</a></li>
        <li><a href="@{Members.changePass()}">修改密码</a></li>
    </ul>

</div>
<div class="simple_wrap">
    <ul class="path_nav">
        <li class="path_index"><a href="@{Application.index(0)}">首页</a></li>
        <li>><a href="@{Members.home()}">个人中心</a></li>
        <li>><a href="@{Members.work()}">我的项目</a></li>
        <li>>发件箱</li>
    </ul>

    <ul class="work_main_nav">
        <li><a href="@{Concerns.myTrend(0)}">动态</a></li>
        <li><a href="@{Members.work(0)}">我的作品</a></li>
        <li><a href="@{Concerns.myConcern(0)}">关注</a></li>
        <li><a href="@{Collections.collectWork(0)}">收藏</a></li>
    </ul>
    <a href="#" class="email-select" id="select">全选</a>
    <a href="#" class="email-delete" id="delete">删除</a>    <div class="clear"></div>
#{if webServiceBean.data.size==0}
    <h3 class="no_content">暂时还没有内容</h3>
#{/if}
#{list items:webServiceBean.data, as:"item"}
    <div class="email_wrap">
        <input type="checkbox" class="email_wrap_checkbox" name='checkbox' alt="${item.userId}" value="${item.MailId}"/> <a href="#top" class="replayImg"><img src="${item.url}" alt=""  class="email_wrap_img"/></a><div class="email_title"><p>${item.authorName}</p><p> ${new Date(item.time).format('yyyy-MM-dd hh:mm:ss')}</p></div>
        <div class="email_info">${item.content}</div>
    </div>
#{/list}
#{page1 pageBean: pageBean, params : params/}




</div>
<script type="text/javascript">

    /**
     * 删除信
     */
    $('#select').click(function (event) {
        event.preventDefault();
        $("[name='checkbox']").attr("checked",'true');//全选

    });
    $('#delete').click(function (event) {
        event.preventDefault();
        var str=""
        $('[name="checkbox"]:checked').each(function() {
            str = str +$(this).val()+" ";
        });
        var data={};
        data.mailId=str;
        $.post("@{Api.deleteSendMail()}", data, function(res) {
            location.reload();
        });
    })

</script>